package com.ptma.controllers;

import javax.servlet.http.HttpServletRequest;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping(value = "/secure")
public class SecureLinkNavigator extends AbstractController {

	@RequestMapping(value = "/create_application.html", method = RequestMethod.GET)
	public ModelAndView secureCreateApplication(Model model,
			HttpServletRequest request) {

		model.addAttribute("pageTitle", getProperty("title.createApp"));
		model.addAttribute("pkgName", request.getParameter("pkgName"));
		model.addAttribute("versionName", request.getParameter("versionName"));
		model.addAttribute("versionCode", request.getParameter("versionCode"));
		model.addAttribute("appName", request.getParameter("pkgName"));
//		Authentication auth = SecurityContextHolder.getContext()
//				.getAuthentication();
//		String email = auth.getName();
//
//		if (null != email) {
//		}

		return new ModelAndView("/create_application");
	}

}
